Java使用freemarker导出图片对应图关系

freemarker的导出文件ftl

关键点

1 中的r:embed rId1003 对应 3中的Id rId1003
2 中的pkg:name /word/media/image3.jpeg 对应 3中的Target media/image3.jpeg

1,图片的占位

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<w:drawing>
<wp:inline distT="0" distB="0" distL="0" distR="0">
<wp:extent cx="457200" cy="201706"/>
<wp:effectExtent l="0" t="0" r="0" b="8255"/>
<wp:docPr id="2" name="图片 2"/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks noChangeAspect="1"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/>
</wp:cNvGraphicFramePr>
<a:graphic
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic
xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:nvPicPr>
<pic:cNvPr id="0" name="test.jpg"/>
<pic:cNvPicPr/>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId1003" cstate="print">
<a:extLst>
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
<a14:useLocalDpi val="0"
xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"/>
</a:ext>
</a:extLst>
</a:blip>
<a:stretch>
<a:fillRect/>
</a:stretch>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="465474" cy="205356"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:inline>
</w:drawing>

2 图片Base64 放的位置

1
2
3
<pkg:part pkg:name="/word/media/image3.jpeg" pkg:contentType="image/jpeg" pkg:compression="store">
<pkg:binaryData>/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgA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wbPHGIVm0Tw7aWEoQYwu+KNWI4HU0UUAejLEqHgc+vc07GKKKACiiigAooooAKCMiiigD5X/AOCq/wDwSn8J/wDBWb4ReH/BfjDxd428KaXoGrjViNAvEjW/PlsnlzRSq8UmMhlZkLIQcEB2B9A/YU/YH+GP/BOr4EWPw/8AhboK6TpEBE15dzES6hrVzgBrq7mABllbA5wFUAKiooCgooA9oxgUx4FdcEUUUAeQftj/ALBHwk/b3+GUnhP4reCtI8WacFcWk88ey+0t2xmS1uFxLA/AJKMA2MMGGRXwD/wSp/4No/8Ah2v+17448fN8XNU1rw3q+jT6FoFnYWpsdTW2mure43Xk+4ozoLZExGgWQsX/AHeAhKKAP//Z</pkg:binaryData>
</pkg:part>

3对应关系

1
2
3
<Relationships>
<Relationship Id="rId1003" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/image3.jpeg"/>
</Relationships>
继开 wechat
欢迎加我的微信,共同交流技术